<?php
/**
 * Template Name: Perspective test
 * 
 */
if (!isset($_GET['ajax']) || ((bool) $_GET['ajax']) === false) {
    get_header();
}
?>
<!-- layout -->
<div class="rootFrame perspective">
    <div class="tvScreenWrap">
        <div id="tvScreen" class="tvScreen">       
<!--            <video width="100%" height="100%" autoplay="autoplay" muted="muted" loop="loop" >
                <source src="http://localhost/wp/wp-content/uploads/2011/09/island.webm" type="video/webm" />
                Your browser does not support the video tag.
            </video>-->
        </div>
    </div>
</div>
<!-- logic -->
<script type="text/javascript"> 
    //create namespace for this slide using anonymous function
    (function(){
        
        var slide = ads_client.getPresentation().getCurrentSlide();

        slide.registerWidget('widgets', { start : function(){  
            this.video = new Element('video', {src : 'http://localhost/wp/wp-content/uploads/2011/09/island.webm', width : '100%', height : '100%', muted: 'muted'});
            this.video.inject($('tvScreen')); 
            this.video.play();
        }, stop : function(){
            this.video.stop();
        }});
        //register action
        slide.registerAction('nextSlide', function(){
            //next slide after 30s
            (function(){
                ads_client.getPresentation().slide();
            }).delay(30*1000); 
        });
    })();
</script>
<?php
if (!isset($_GET['ajax']) || ((bool) $_GET['ajax']) === false) {
    get_footer();
}
?>